#include<iostream>
int main()
{
	using namespace std;

	int p, r, n, m, temp;
	cout << "cin n,m(n>m):";
	cin >> n >> m;
	if (n < m)
	{
		temp = n;
		n = m;
		m = temp;

	}

	p = m * n;

	while (m != 0)
	{
		r = n % m;
		n = m;
		m = r;


	}

	cout << "hcf=" << n << endl;
	cout << "lcd=" << m << endl;

	return 0;
}